package com.api.oa.services.impl;

import com.api.oa.mapper.YQInsPatientHisMapper;
import com.api.oa.model.entity.YQInsPatientHis;
import com.api.oa.model.vo.OaOrgTreeVO;
import com.api.oa.services.YQInsPatientHisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import java.util.List;


@Service
public class YQInsPatientHisServiceImpl implements YQInsPatientHisService {

    @Autowired
    private YQInsPatientHisMapper mapper;


    @Override
    public Integer add(YQInsPatientHis entity) {
        return mapper.insert(entity);
    }

    @Override
    public void remove(Long id) {
        mapper.delete(id);
    }

    @Override
    public Integer update(YQInsPatientHis entity) {
        return mapper.update(entity);
    }

    @Override
    public PageInfo<YQInsPatientHis> list(Long pid,Integer pageIndex,Integer pageSize) {
        PageHelper.startPage(pageIndex,pageSize);
        PageHelper.orderBy("historyId desc");
        return new PageInfo<>(mapper.list(pid));
    }

    @Override
    public YQInsPatientHis one(Long id) {
     return mapper.findOne(id);
    }



}
